aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/sent/[id]
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-09-23 16:22:10 -0700
committerAdam Soltys <[email protected]>2024-09-23 16:22:10 -0700
commit52871e09d9218f3f2fb2ce4bd6e97f5c1fc15480 (patch)
tree543a0af922d193940846e7a953ed7b027a931e30 /src/routes/(app)/sent/[id]
parent200c5ff1f4e41ed907a1dd4a0337d8ee0a94b8be (diff)
downloadcoinos-ui-52871e09d9218f3f2fb2ce4bd6e97f5c1fc15480.tar.gz
coinos-ui-52871e09d9218f3f2fb2ce4bd6e97f5c1fc15480.zip
account import
Diffstat (limited to 'src/routes/(app)/sent/[id]')
-rw-r--r--src/routes/(app)/sent/[id]/+page.server.ts7
-rw-r--r--src/routes/(app)/sent/[id]/+page.svelte49
2 files changed, 56 insertions, 0 deletions
diff --git a/src/routes/(app)/sent/[id]/+page.server.ts b/src/routes/(app)/sent/[id]/+page.server.ts
new file mode 100644
index 00000000..38d95e4e
--- /dev/null
+++ b/src/routes/(app)/sent/[id]/+page.server.ts
@@ -0,0 +1,7 @@
+import { get, auth } from "$lib/utils";
+
+export let load = async ({ cookies, params }) => {
+ let { id } = params;
+ let p = await get(`/payments/${id}`, auth(cookies));
+ return p;
+};
diff --git a/src/routes/(app)/sent/[id]/+page.svelte b/src/routes/(app)/sent/[id]/+page.svelte
new file mode 100644
index 00000000..24804974
--- /dev/null
+++ b/src/routes/(app)/sent/[id]/+page.svelte
@@ -0,0 +1,49 @@
+<script>
+ import { fiat, f, focus, s, sat, sats } from "$lib/utils";
+ import { scale } from "svelte/transition";
+ import Icon from "$comp/Icon.svelte";
+ import { toast } from "@zerodevx/svelte-toast";
+ import { t } from "$lib/translations";
+
+ export let data;
+ let { amount, rate, tip, user } = data;
+ let { currency, username } = user;
+ amount = Math.abs(amount);
+
+ toast.pop(0);
+</script>
+
+<div class="text-center mt-20 md:mt-0">
+ <div
+ class="flex w-full max-w-[200px] mx-auto py-20"
+ in:scale={{ start: 0.5 }}
+ >
+ <Icon icon="check" style="mx-auto" />
+ </div>
+ <h1 class="text-3xl md:text-4xl font-bold mb-6">{$t("payments.sent")}!</h1>
+ <h2 class="text-2xl md:text-3xl font-semibold">
+ {f(fiat(amount, rate), currency)}
+ {#if tip}
+ <span class="text-lg">
+ + {f(fiat(tip, rate), currency)}
+ </span>
+ {/if}
+ </h2>
+ <h3 class="text-secondary md:text-lg mb-6 mt-1">
+ ⚡️{s(amount)}
+
+ {#if tip}
+ <span class="text-lg">
+ + ⚡️{s(tip)}
+ </span>
+ {/if}
+ </h3>
+</div>
+
+<a href={`/${username}`} use:focus>
+ <div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50" />
+</a>
+
+<div class="fixed bottom-10 w-full text-center">
+ {$t("payments.tapAnywhere")}
+</div>